﻿using FDStudio.Core.Entities.Query;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace FDStudio.Core.Generates
{
    /*
     CreatedOn: 2018-01-26
     CreatedBy: Jackie Lee(天宇遊龍)
     */
    /// <summary>
    /// 映射生成
    /// </summary>
    public interface IModelGenerator
    {
        string InsertString<T>(T model, out IDictionary<string, object> parameters);

        string UpdateString<T>(Expression<Func<T, bool>> condition);

        string DeleteString<T>(Expression<Func<T, bool>> condition);

        string QueryString<T>(Expression<Func<T, bool>> condition) where T : class;

        string QueryString<T>(Expression<Func<T, bool>> condition, IQueryOrder<T> orderBy) where T : class;

        /// <summary>
        /// 计数查询
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="condition"></param>
        /// <returns></returns>
        string CountString<T>(Expression<Func<T, bool>> condition);
    }
}
